<!doctype html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>blog</title>
    <link rel="stylesheet" href="/public/bootstrap/css/bootstrap.min.css">
    <style>
        body, html {
            background: #f1f1f1;
        }

        .nav-wrap {
            background: #fff;
        }
    </style>

</head>
<body>
<div id="app">
    <div class="">
        <img class="img-responsive" src="/public/images/banner.jpg" alt="banner">
    </div>

    <nav class="navbar nav-wrap">
        <div class="container">
            <ul class="nav navbar-nav">
                <li role="presentation"><a href="#">Disabled link</a></li>
                <li role="presentation"><a href="#">Disabled link</a></li>
                <li role="presentation"><a href="#">Disabled link</a></li>
                <li role="presentation"><a href="#">Disabled link</a></li>
                <li role="presentation"><a href="#">Disabled link</a></li>
            </ul>
        </div>
    </nav>
    <hr>
    <div class="container">
        <div class="row">
            <div class="col-md-7">
                <div class="thumbnail">
                    <img src="..." alt="...">
                    <div class="caption">
                        <h3>Thumbnail label</h3>
                        <p>...</p>
                        <p><a href="#" class="btn btn-primary" role="button">Button</a>
                            <a href="#" class="btn btn-default" role="button">Button</a>
                        </p>
                    </div>
                </div>
            </div>
            <div class="col-md-5">

                {% if userInfo._id %}
                <div class="infoBox panel panel-default">
                    <div class="panel-heading">
                        <h4>用户信息</h4>
                    </div>
                    <div class="panel-body">
                        <div class="alert alert-success" role="alert">
                            <span> {{ userInfo.username }}</span>
                            {% if userInfo.isAdmin %}
                            <span>你好,管理员</span><a href="/admin">进入管理</a>
                            {% else %}
                            <span>你好，欢迎光临我的博客</span>
                            {% endif %}
                        </div>
                        <p style="text-align: right">
                            <span> <a class="logout" href="javascript:;">退出</a></span>
                        </p>
                    </div>
                </div>
                {% else %}
                <div class="loginBox panel panel-default">
                    <div class="panel-heading">
                        <h4>登陆</h4>
                    </div>
                    <div class="panel-body">
                        <div class="alert alert-danger loginTip" style="display: none" role="alert"></div>
                        <form>
                            <div class="form-group">
                                <label>账号</label>
                                <input type="text" class="form-control" name="username" placeholder="输入账号">
                            </div>
                            <div class="form-group">
                                <label>密码</label>
                                <input type="password" class="form-control" name="password"
                                       placeholder="输入密码">
                            </div>

                            <button type="button" class="btn btn-default loginBtn">登陆</button>

                        </form>
                        <p style="text-align: right">
                            <span>还没注册？<a href="javascript:;">马上注册</a></span>
                        </p>
                    </div>

                </div>

                <div class="registerBox panel panel-default" style="display: none;">
                    <div class="panel-heading">
                        <h4>注册</h4>
                    </div>
                    <div class="panel-body">
                        <div class="alert alert-danger registerTip" style="display: none;" role="alert"></div>
                        <form>
                            <div class="form-group">
                                <label>账号</label>
                                <input type="text" class="form-control" name="username2" placeholder="账号">
                            </div>
                            <div class="form-group">
                                <label>密码</label>
                                <input type="password" class="form-control" name="password2"
                                       placeholder="密码">
                            </div>
                            <div class="form-group">
                                <label>确认密码</label>
                                <input type="password" class="form-control" name="qrPwd2"
                                       placeholder="确认密码">
                            </div>
                            <button type="button" class="btn btn-default registerBtn">注册</button>
                        </form>
                        <p style="text-align: right">
                            <span>已有账号 <a href="javascript:;">马上登陆</a></span>
                        </p>
                    </div>
                </div>
                {% endif %}
            </div>
        </div>
    </div>
</div>
</body>
<script src="/public/js/jquery-3.3.1.min.js"></script>
<script src="/public/js/index.js"></script>
</html>